package com.xuebusi.ribbon.loadbalance.provider.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
public class ResultVO<T> {
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time = new Date();
    private String message = "ok";
    private T data;

    /**
     * 定义了有参构造方法，同时应通过@NoArgsConstructor提供无参构造方法，否则会报错
     *
     * @param data
     */
    public ResultVO(T data) {
        this.data = data;
    }
}
